Hi everyone, how can i put the outputs of the print function used in the below code
bool compare(int absno, Object o1, o2, string attr) {
string s1, s2
s1 = o1.attr
s2 = o2.attr
if (s1!=s2) {
print "object #" absno " has differing " attr "\n<\t" s1 "\n>\t" s2 "\n"
accept o1 // set filter
accept o2 // on both objects
return false
}
return true
}
SystemAdmin - Fri May 15 09:48:13 EDT 2009 |
Re: How to put outputs of the print function into a textbox? |
Re: How to put outputs of the print function into a textbox?
Using TABs was a nightmare for me years ago; never did it again. I don't recall everything, but you had to associate the top/bottom/left/right of each DBE with each other. Good luck. Someday I'll write some library functions to make that easier.
void print(string PrintString)
{ infoBox("This string was supposed to be printed:\n" PrintString)
}
|
Re: How to put outputs of the print function into a textbox? Then either realize a text box or set a text box with the value of the buffer. This approach is faster than a print statement. |
Re: How to put outputs of the print function into a textbox? I put together the attached DXL as an example. A few things: 1.) You'll see how to set up tabs. You need a "ChooseTab" function that hides and shows the proper dialog box elements. Also, you need to declare DBEs in the same order that you place them in the DB. 2.) In your "compare" function, I see you are passing in "absno", but presumably that is a function of either o1 or o2. You can use o1."Absolute Number" to get the absno from within the function. In my example, I use identifier(o1), which is similar 3.) When you say "recursive", it's not entirely clear to me what you are trying to do. In my example, I run through the entire module, comparing every Object to the next Object, and showing any changes in attribute value. 4.) Be aware that the "for Object in entire(Module)" loop includes deleted objects. You can strip these out by adding another IF statement, such as "if(!isDeleted(xObject)) {// do somehting}" Let me know if you have other questions. Attachments attachment_14252743_CompareAttributes.dxl |
Re: How to put outputs of the print function into a textbox? djakad - Mon May 18 18:23:11 EDT 2009 Please see attached DXL. I had to fix a couple things. Attachments attachment_14252744_CompareAttributes_FIX.dxl |
Re: How to put outputs of the print function into a textbox? djakad - Mon May 18 18:34:31 EDT 2009 |
Re: How to put outputs of the print function into a textbox? My script does not print all the Object Texts, it only shows the last element put in the buffers. How can I print all the Objects Texts and their differences ? Thanks DB db = create "Show diff" DBE textbox = richText(db, "Text Modification", "", 200, 200, true) Buffer exitext = create() Buffer exittext = create() Buffer resBuf = create() for loop { exitext=obj_v1."Object Text" exittext=obj_v2."Object Text" diff(resBuf, exitext,exittext, "\\cf1\\strike ", "\\cf3\\ul ") } realize db useRTFColour(textbox, true) set(textbox, tempStringOf resBuf) show db delete resBuf delete exittext delete exitext |
Re: How to put outputs of the print function into a textbox? izzo - Fri Oct 01 05:17:44 EDT 2010 a) use the { C O D E } statement for posting code b) don't pull 1 year old answered threads c) use a real name d) visit a DXL training, OR read the fmanual of the 'show' function (put no statements below!), read the manual of the set(textfield, ...) function, which will not add something to a text field, but replace its contents.) Mathias |